package com.fit.carservice.pages;

import java.util.LinkedList;

import org.apache.tapestry5.Block;
import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SetupRender;
import org.apache.tapestry5.corelib.components.Zone;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.fit.beans.CarBean;
import com.fit.interfaces.CarI;
import com.fit.service.CarsI;

public class EntryCar
{
	@Persist
	@Property
	private CarI currentCar;
	
	
	
	@Property
	@Inject
	private Block edit;
	
	@Property
	@Inject
	private Block congratulations;
	
	@Inject
	private CarsI cars;
	
	@SetupRender
	public void createObject(){
		currentCar = new CarBean();
		
	}
	
	Object onSuccess(){
			
		  cars.save(currentCar);
		return congratulations;
	}
}
